import java.util.ArrayList;
import java.util.List;

public class Solution830 {
    public List<List<Integer>> largeGroupPositions(String s) {
        s=s.concat(" ");
        int first=0;
        List<List<Integer>> ans=new ArrayList<>();
        for (int i=1;i<s.length();i++){
            if (s.charAt(i)!=s.charAt(i-1)){
                if (i-first>=3){
                    List<Integer> t=new ArrayList<>();
                    t.add(first);
                    t.add(i-1);
                    ans.add(t);
                }
                first=i;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution830().largeGroupPositions("abbxxxxzzy"));
    }
}
